<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>vue</title>
		<script type="text/javascript" src="js/vue.js" ></script>
		<style>
			.v-enter, .v-leave-to {
				opacity: 0;
			}
			.v-enter-active, .v-leave-active {
				transition: opacity 1s;
			}
		</style>
	</head>
	<body>
		<div id="root">
			<transition>
				<!--<div v-if="show">Hello World</div>-->
				<div v-show="show">Hello World</div>
			</transition>
        	<button @click="handleBtnClick">切换</button>
        </div>
		
		<script>
			var vm = new Vue({
				el: '#root',
				data: {
					show: true
				},
				methods: {
					handleBtnClick: function() {
						this.show = !this.show
					}
				}
			})
			
		</script>
	</body>
</html>
